home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / smaltalk / gnu_st.lha / gnu_st / smalltalk-1.1.1 / ymakefile < prev   
Makefile  |  1991-09-12  |  6KB  |  220 lines

  1. /*******************************************************************
  2.  * 
  3.  * Copyright (C) 1990, 1991 Free Software Foundation, Inc.
  4.  * Written by Steve Byrne.
  5.  * 
  6.  * This file is part of GNU Smalltalk.
  7.  *  
  8.  * GNU Smalltalk is free software; you can redistribute it and/or modify it
  9.  * under the terms of the GNU General Public License as published by the Free
  10.  * Software Foundation; either version 1, or (at your option) any later 
  11.  * version.
  12.  * 
  13.  * GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
  14.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15.  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  16.  * more details.
  17.  * 
  18.  * You should have received a copy of the GNU General Public License along with
  19.  * GNU Smalltalk; see the file COPYING.  If not, write to the Free Software
  20.  * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  *
  22.  ********************************************************************/
  23.  
  24. #include "mstconfig.h"
  25. #include "mstpaths.h"
  26.  
  27. #ifndef DEFAULT_LIBRARIES
  28. #define DEFAULT_LIBRARIES -lm
  29. #endif
  30.  
  31. /* The configuration files can define extra flags for the C compiler
  32.  * using this definition
  33.  */
  34. #ifndef EXTRA_CC_FLAGS
  35. #define EXTRA_CC_FLAGS
  36. #endif
  37.  
  38.  
  39. #ifdef USE_READLINE
  40. /* assumes that readline is installed in ./readline */
  41. READLINEDEF = -DUSE_READLINE -I.
  42. READLINELIB = -L./readline -lreadline -ltermcap
  43. #endif
  44.  
  45.  
  46. #ifndef SYSTEM_MALLOC
  47. #ifdef HAVE_ALLOCA
  48. mallocobj = malloc.o
  49. #else
  50. mallocobj = alloca.o malloc.o
  51. #endif
  52. #endif
  53.  
  54.  
  55. /* just to be sure the sh is used */
  56. SHELL=/bin/sh
  57.  
  58. /* Enable recompilation of certain other files depending on system type.  */
  59.  
  60. #ifndef OTHER_FILES
  61. #define OTHER_FILES
  62. #endif
  63.  
  64. /* Enable inclusion of object files in temacs depending on system type.  */
  65. #ifndef OBJECTS_SYSTEM
  66. #define OBJECTS_SYSTEM
  67. #endif
  68.  
  69. #ifndef OBJECTS_MACHINE
  70. #define OBJECTS_MACHINE
  71. #endif
  72.  
  73.  
  74. /* Some machines have alloca built-in.
  75.    They should define HAVE_ALLOCA, or may just let alloca.s
  76.    be used but generate no code.
  77.    Some have it written in assembler in alloca.s.
  78.    Some use the C version in alloca.c (these define C_ALLOCA in mstconfig.h).
  79.    */
  80.  
  81. #ifdef C_ALLOCA
  82. ALLOCA = alloca.o alloc.o
  83. alloca.o: alloca.c
  84. #else
  85. #ifdef NEED_ALLOCA
  86. ALLOCA = alloca.o
  87. alloca.o : alloca.s mstconfig.h
  88. /* $(CPP) is cc -E, which may get confused by filenames
  89.    that do not end in .c.  So copy file to a safe name.  */
  90.     cp alloca.s allocatem.c
  91. /* remove any ^L, blank lines, and preprocessor comments,
  92.    since some assemblers barf on them */
  93.     $(CPP) allocatem.c | \
  94.     sed -e 's/ //' -e 's/^#.*//' | \
  95.     sed -n -e '/^..*$$/p' > allocatem.s
  96.     -rm -f alloca.o
  97. /* Xenix, in particular, needs to run assembler via cc.  */
  98.     cc -c allocatem.s
  99.     mv allocatem.o alloca.o
  100.     rm allocatem.s allocatem.c
  101. #endif /* NEED_ALLOCA */
  102. #endif /* not C_ALLOCA */
  103.  
  104.  
  105.  
  106. /* System-specific programs to be made.
  107.    OTHER_FILES, OBJECTS_SYSTEM and OBJECTS_MACHINE
  108.    select which of these should be compiled.  */
  109.  
  110.  
  111.  
  112. /*************
  113.  *
  114.  * These variables you may wish to change
  115.  *
  116.  *************/
  117.  
  118. /* Mail path to GNU Smalltalk maintainer (Steve Byrne) */
  119. MAINTAINER = 'nfsun!sbyrne@uunet.uu.net'
  120.  
  121. /* Compilation flags definitions */
  122. CFLAGS_NORMAL   = -g EXTRA_CC_FLAGS 
  123. CFLAGS_PROFILE  = -g -pg -DUSE_MONCONTROL EXTRA_CC_FLAGS 
  124. CFLAGS_OPTIMIZE = -O -DOPTIMIZE EXTRA_CC_FLAGS 
  125.  
  126. /* Actual compilation flags and compiler definition */
  127. CFLAGS = $(CFLAGS_NORMAL) $(READLINEDEF)
  128.  
  129.  
  130.  
  131. /********************************************************************
  132.  * The following definitions are not something that the casual user would
  133.  * want to change.
  134.  ********************************************************************/
  135.  
  136. OBJS =  mstmain.o   mst.tab.o   mstlex.o    mststr.o    mstid.o \
  137.     msttree.o   mstbyte.o   mstinterp.o mstcomp.o   mstsym.o \
  138.     mstdict.o   mstoop.o    mstsave.o   mstcint.o     mstsysdep.o \
  139.     $(USER_OBJS) $(ALLOCA)
  140.  
  141. SRCS =  mstmain.c   mst.tab.c   mstlex.c    mststr.c    mstid.c \
  142.     msttree.c   mstbyte.c   mstinterp.c mstcomp.c   mstsym.c \
  143.     mstdict.c   mstoop.c    mstsave.c   mstcint.c     mstsysdep.c
  144.  
  145.  
  146. LIBS =  DEFAULT_LIBRARIES $(USER_LIBS) $(READLINELIB)
  147.  
  148.  
  149. all: mst
  150.  
  151. mst: $(OBJS)
  152.     $(CC) -o mst $(CFLAGS) $(OBJS) $(LIBS)
  153.  
  154. mst.tab.h mst.tab.c: mst.y
  155.     bison -dv mst.y
  156.  
  157. mstmain.o mstlex.c: mst.tab.h
  158.  
  159. mstlex.o: mst.tab.h
  160.  
  161. /* These depend on the oop table size */
  162. mstsave.o mstoop.o mstmain.o mstsym.o: mstoop.h
  163.  
  164. /*
  165.  * Install the files into the proper place
  166.  */
  167.  
  168. install:
  169.     if test ! -d KERNEL_PATH ; then      \
  170.         mkdir -p KERNEL_PATH ;           \
  171.     fi
  172.     cp *.st KERNEL_PATH
  173.     (cd KERNEL_PATH; chmod +r *.st)
  174.     if test ! -d IMAGE_PATH ; then      \
  175.         mkdir -p IMAGE_PATH ;           \
  176.     fi
  177.     (x=`pwd`; cd IMAGE_PATH; $$x/mst -Vi)
  178.  
  179. /***
  180.  *** Experimental Linting of the code
  181.  ***/
  182. lint: $(SRCS)
  183.     lint $(SRCS)
  184.  
  185. lexdebug:
  186.     $(CC) -c $(XCFLAGS) -DLEXDEBUG mstmain.c
  187.     $(MAKE) -f xmakefile mst
  188.  
  189. profile:
  190.     make CFLAGS='$(CFLAGS) -pg -Dprofiling'
  191.  
  192. senddiffs: diffs
  193.     kermit -e 1000 -s mst.diffs
  194.  
  195. mail-diffs:
  196.     @echo "Please enter a brief note describing the contents of"
  197.     @echo "the diffs file that you've created.  End with Ctrl-D."
  198.     @cat > mst.diffs.note
  199.     @echo "-----------------------------------" >> mst.diffs.note
  200.     @### If there's a more portable/better way to do this, please
  201.     @### don't hesitate to fix this and send the new version back -- SBB
  202.     @cat mst.diffs.note mst.diffs | mail $(MAINTAINER)
  203.  
  204. diffs:
  205.     mk_mst_diffs
  206.  
  207. setup:
  208.     @if [ -f ./orig ] ; then \
  209.         echo "./orig exists, but is not a directory" ; \
  210.         exit 1 ; \
  211.     fi
  212.     rm -rf ./orig
  213.     mkdir ./orig
  214.     tar cbf 20 - `cat mstfiles` | (cd ./orig; tar xbBf 20 -)
  215.  
  216.  
  217.  
  218.  
  219.  
  220.